App.define('ajax', function () {
	var ajax = App.emptyFn;
	try {
		ajax = function (a, b) {
			$.ajax(a, b);
		};

		ajax.getJSON = function (a, b, c) {
			$.getJSON(a, b, c);
		};
		App.getJSON = ajax.getJSON;

		ajax.get = function (a, b, c, d) {
			$.get(a, b, c, d);
		};

		ajax.getScript = function (a, b) {
			$.getScript(a, b);
		};
		App.getScript = ajax.getScript;

		ajax.getScripts = function (urls, callback) {
			if (App.isUndefined(urls) || urls.length == 0) {
				if (callback) callback();
				return;
			}

			var count = urls.length, n = 0;

			for (var i = 0; i < count; i++) {
				$.getScript(urls[i], _callback);
			}

			function _callback() {
				n++;
				if (n < count) return;
				if (!App.isUndefined(callback)) callback();
			}

		};
		App.getScripts = ajax.getScripts;

	} catch (e) {
		console.error('ajax.module.js', e);
	}

	return ajax;
});